package edu.sctu.practice.class02.hujie.cgs.practice02.test17;

/**
 * Created by hj on 2015/10/26.
 */
public class Son extends Father {
    public Son() {
        this.money = 1000000;
        car = 2;
    }

    public void runcar() {
        System.out.println("跑跑卡丁车");
    }

    public void eat() {
        System.out.println("中式大餐");
    }

    public static void main(String[] args) {
         /*仔细分析这三个句语句什么意思*/
        Father one = new Father();

        Father two = new Son();

        Son three = new Son();
        System.out.println("father:" + one.car);
        System.out.println("father:" + one.money);
        one.eat();
        one.runcar();

        System.out.println("father:" + two.car);
        System.out.println("father:" + two.money);
        two.eat();
        two.runcar();

        System.out.println("father:" + three.car);
        System.out.println("father:" + three.money);
        three.eat();
        three.runcar();
    }
}
